package Threads.Jvm.ByteCode;

/*
         1: istore_1
         2: iconst_0
         3: istore_2
         4: iload_1
         5: bipush        10
         7: if_icmpge     21
        10: iload_2
        11: iinc          2, 1
        14: istore_2
        15: iinc          1, 1
        18: goto          4
        21: getstatic     #2                  // Field java/lang/System.out:Ljava/io/PrintStream;
        24: iload_2
        25: invokevirtual #3                  // Method java/io/PrintStream.println:(I)V
        28: return

 */

public class Demo4 {
    public static void main(String[] args) {
        int i=0;
        int x=0;
        while (i<10){
            x=x++;  //先将x加载到操作数栈，然后局部变量中的x++，然后又把加载到操作数栈的x写回局部变量表，导致x一直没有改变
            i++;
        }
        System.out.println(x);//  x=0
    }
}
